{extend name="base"/}
{block name="css"}
<style>
    .layui-body {
        position: absolute;
        left: 200px;
        right: 0;
        top: 20px;
        bottom: 0;
        z-index: 998;
        width: auto;
        overflow: hidden;
        overflow-y: auto;
        box-sizing: border-box;
    }
</style>
{/block}
{block name="content"}
<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-lg12">
            <fieldset class="layui-elem-field">
                <legend>关闭网站</legend>
                <div class="layui-field-box">
                   <form class="layui-form" id="formId" action="{url:(backend/config/close)}" method="post" onsubmit="return sub();">
                        <div class="layui-form-item">
                             <label class="layui-form-label">关闭网站:</label>
                             <div class="layui-input-block" >
                                <input  type="radio" {if $con['close_net'] == 1} checked="checked" {/if} name="close_net" value="1" title="关闭">
                                <input  type="radio" {if $con['close_net'] == 0} checked="checked" {/if} name="close_net" value="0" title="打开">
                             </div>
                        </div>
                        <div class="layui-form-item">
                             <label class="layui-form-label">提示信息:</label>
                             <div class="layui-input-block">
                                <input type="text" name="close_net_content" required  lay-verify="required" value="{$con['close_net_content']}" class="layui-input" >
                             </div>
                        </div>
                        <div class="layui-form-item">
                             <label class="layui-form-label">关闭注册:</label>
                             <div class="layui-input-block" style="padding-top:10px;">
                                <input  type="radio" {if $con['close_reg'] == 1} checked="checked" {/if} name="close_reg" value="1" title="关闭">
                                <input  type="radio" {if $con['close_reg'] == 0} checked="checked" {/if} name="close_reg" value="0" title="打开">
                             </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">提示信息:</label>
                            <div class="layui-input-block">
                                <input type="text" name="close_reg_content" required  lay-verify="required" value="{$con['close_reg_content']}" class="layui-input" >
                            </div>
                        </div>
                        <div class="layui-form-item">
                             <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                             </div>
                        </div>
                   </form>
                </div>
            </fieldset>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            $.ajax({
                cache: true,
                type: "POST",
                url:"{url:(backend/config/close)}",
                data:$('#formId').serialize(),
                async: false,
                success: function(data) {
                    layer.msg("提交成功!");
                    setTimeout(location.reload(),2500);
                }
            });
        });
    });
</script>
<script>
     function sub() {  

    }  

</script>
{/block}
